
import { IsString, IsNumber, IsBoolean, IsDate, IsOptional, IsEnum } from 'class-validator';
import { ApiProperty, OmitType, IntersectionType } from '@nestjs/swagger';
import { PagingDto } from 'src/common/dto/index';
import { CharEnum } from 'src/common/enum/index';
import {CreateUserDto, UpdateUserDto} from "../../../system/user/dto";


export class BaseTeacherDto{
	@ApiProperty({required: false , description: '主键ID'})
	@IsOptional()
	@IsNumber()
	id?: number;

	@ApiProperty({enum: CharEnum, required: false , description: '删除标志'})
	@IsOptional()
	@IsString()
	delFlag?: string;

	@ApiProperty({enum: CharEnum, required: false , description: '状态'})
	@IsOptional()
	@IsString()
	status?: string;

	@ApiProperty({required: false , description: '创建者'})
	@IsOptional()
	@IsString()
	createBy?: string;

	@ApiProperty({required: false , description: '创建时间'})
	@IsOptional()
	@IsString()
	createTime?: string;

	@ApiProperty({required: false , description: '更新者'})
	@IsOptional()
	@IsString()
	updateBy?: string;

	@ApiProperty({required: false , description: '更新时间'})
	@IsOptional()
	@IsString()
	updateTime?: string;

	@ApiProperty({required: false , description: '备注'})
	@IsOptional()
	@IsString()
	remark?: string;

	@ApiProperty({required: true , description: '教师名称'})
	@IsOptional()
	@IsString()
	teacherName: string;

	@ApiProperty({required: true , description: '身份证号码'})
	@IsString()
	@IsOptional()
	idCard: string;

	@ApiProperty({required: true , description: '教师编号'})
	@IsOptional()
	teacherNumber: string;

	@ApiProperty({required: true , description: '性别'})
	@IsOptional()
	@IsString()
	sex: string;

	@ApiProperty({required: true , description: '老师状态'})
	@IsOptional()
	@IsString()
	state: string;

	@ApiProperty({required: true , description: '出生日期'})
	@IsString()
	@IsOptional()
	birthday: string;

	@ApiProperty({required: false , description: '户籍地址'})
	@IsOptional()
	@IsString()
	cardAddress?: string;

	@ApiProperty({required: true , description: '家庭地址'})
	@IsString()
	@IsOptional()
	houseAddress: string;

	@ApiProperty({required: false , description: '紧急联系'})
	@IsOptional()
	emergency?: string;

	@ApiProperty({required: false , description: '教师Id'})
	@IsOptional()
	teacherId?: number;

	@ApiProperty({required: true , description: '归属学校'})
	@IsOptional()
	schoolId: number;


	@ApiProperty({required: true , description: '教师职称'})
	@IsOptional()
	teacherLevel: string;

	@ApiProperty({required: true , description: '最高学历'})
	@IsOptional()
	degree: string;

	@ApiProperty({required: false , description: '教育经历'})
	@IsOptional()
	experience?: string;

}
export class CreateTeacherDto extends OmitType(IntersectionType(BaseTeacherDto, CreateUserDto), [ 'id', 'delFlag', 'createBy', 'createTime']) {
	@ApiProperty({required: true , description: '用户昵称'})
	@IsOptional()
	nickName: string;
}

export class UpdateTeacherDto extends OmitType(IntersectionType(BaseTeacherDto, UpdateUserDto), [ 'delFlag', 'createBy', 'createTime']){
	@ApiProperty({required: true , description: '用户昵称'})
	@IsOptional()
	nickName: string;

	@ApiProperty({required: true , description: '密码'})
	@IsOptional()
	password: string;
}

export class QueryTeacherDto extends IntersectionType( BaseTeacherDto, PagingDto){}

export class ListTeacherDto  extends OmitType(BaseTeacherDto, [ 'delFlag', 'createBy', 'createTime', 'updateBy', 'updateTime']) {}
